IdeaBlade DevForce 2010 Help Reference
GetActions() Method
See Also  Example Send Feedback
IdeaBlade.Core Assembly > IdeaBlade.Core Namespace > PropertyInterceptor<TInstance,TValue,TArgs> Class > GetActions Method : GetActions() Method



Retrieve all actions for the interceptor.

Syntax

Visual Basic (Declaration) 
Public Overloads Function GetActions() As IEnumerable(Of PropertyInterceptorAction(Of TArgs))
Visual Basic (Usage)Copy Code
Dim instance As PropertyInterceptor(Of TInstance,TValue,TArgs)
Dim value As IEnumerable(Of PropertyInterceptorAction(Of TArgs))
 
value = instance.GetActions()
C++/CLI 
public:
IEnumerable<PropertyInterceptorAction<TArgs^>^>^ GetActions(); 

Example

C#Copy Code
public void Sample() {

    DomainModelEntityManager mgr = DomainModelEntityManager.DefaultManager;
    Customer c1 = mgr.Customers.First();

    // Look at all before set actions affecting customer company name
    foreach (var action in Customer.CompanyNameEntityProperty.SetterInterceptor.GetActions(PropertyInterceptorTiming.Before, typeof(Customer))) {
      Console.WriteLine(action.Key + " = " + action.Order);
    }

    // Skip an action
    Customer.CompanyNameEntityProperty.SetterInterceptor.AddSkipKey("A");

    // Set property - output window will show which actions were performed.
    c1.CompanyName = "Boxes n Things";

    // Now include the skipped action.
    Customer.CompanyNameEntityProperty.SetterInterceptor.RemoveSkipKey("A");

    // Set property - we should see all actions invoked.
    c1.CompanyName = "Boxes n Stuff";
  }
  
public partial class Customer {

  [BeforeSet(Key = "A")]
  public void BeforeSetAnyCustomerProperty(IEntityPropertySetInterceptorArgs args) {
    Console.WriteLine("Customer any - before setting " + args.EntityProperty.Name);
  }

  [BeforeSet("CompanyName", Key = "B")]
  public void BeforeSetCompanyName(IEntityPropertySetInterceptorArgs args) {
    Console.WriteLine("Customer companyname - before setting company name");
  }
}

Remarks

Skipped keys are not included in the return list.

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2013 All Rights Reserved.